<!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <link rel="shortcut icon" href="../images/favicon.ico">
    <link rel="apple-touch-icon-precomposed" href="../images/apple-touch-icon.png">
	<title>loading</title>
	<link rel="stylesheet" href="../../dist/seedsui.min.css">
</head>

<body ontouchstart="">
	<header>
		<div class="titlebar">
	        <a class="titlebar-button" href="javascript:back()"><i class="icon icon-arrowleft"></i></a>
	        <h1 class="titlebar-title">loading</h1>
	    </div>
	</header>
	<article>
        <a class="button submit block" style="margin:12px 10px;" id="ID-BtnShowLoad">显示spinning遮罩</a>
        <a class="button submit block" style="margin:12px 10px;" id="ID-BtnShowLoadFad">显示fading遮罩</a>
	</article>
    <!-- 加载遮罩 -->
    <div class="loading-mask mask" id="ID-LoadingFad">
        <div class="loading-fading">
            <div class="loading-fading-wrapper">
                <div class="loading-fading-blade"></div>
                <div class="loading-fading-blade"></div>
                <div class="loading-fading-blade"></div>
                <div class="loading-fading-blade"></div>
                <div class="loading-fading-blade"></div>
                <div class="loading-fading-blade"></div>
                <div class="loading-fading-blade"></div>
                <div class="loading-fading-blade"></div>
                <div class="loading-fading-blade"></div>
                <div class="loading-fading-blade"></div>
                <div class="loading-fading-blade"></div>
                <div class="loading-fading-blade"></div>
            </div>
            <div class="al-text">加载中...</div>
        </div>
    </div>
    <!-- 旋转loading-spinning -->
    <div class="loading-mask mask" id="ID-Loading" style="background-color: white;">
        <div class="loading-spinning">
            <div class="loading-spinning-wrapper"></div>
        </div>
    </div>
    
    <script src="../../dist/seedsui.min.js"></script>
    <!--Exmobi能力-->
    <!--<script src="../scripts/lib/exmobi/exmobi.js"></script>-->
	<script>
        var view={
            /*=========================
              Model
              ===========================*/
            render:function(){
                var self = this;
                //渲染页面
                /*this.loading=new Loading();
                this.loading.show();*/
                //第二种方法:默认创建好DOM更快
                this.loading=new Loading({
                    container:"#ID-Loading"
                });

                this.loadingFad=new Loading({
                    container:"#ID-LoadingFad"
                });

                //加载数据
                this.loadData();
            },
            refresh:function(){
                console.log("刷新");
            },
            destroy:function(){
                console.log("移除");
            },
            loadData:function(){

                this._attach();//使用backbone时，此行无用
            },
            /*=========================
              Events
              ===========================*/
            _attach:function(e){
                var self=this;
                document.getElementById("ID-BtnShowLoad").addEventListener("click",function(e){
                    self._onClickBtnShowLoad(e);
                },false);
                document.getElementById("ID-BtnShowLoadFad").addEventListener("click",function(e){
                    self._onClickBtnShowLoadFad(e);
                },false);
            },
            /*=========================
              Event Handler
              ===========================*/
            _onClickBtnShowLoad:function(e){
                var self=this;
                this.loading.show();
                setTimeout(function(){
                    self.loading.hide();
                },5000);
            },
            _onClickBtnShowLoadFad:function(e){
                var self=this;
                this.loadingFad.show();
                setTimeout(function(){
                    self.loadingFad.hide();
                },5000);
            }
        }

        window.addEventListener("load",function(){
            view.render();
        }, false);
		//定义exmobi返回
		function back(){history.go(-1);}
	</script>
</body>
</html>